WIP: extract clonable feature from LinOp#2005
Open
yhmtsai wants to merge 18 commits into
Open
Conversation
…at in read_distributed
…s inherit from ClonableObject already
Member
|
Error: The following files need to be formatted: You can find a formatting patch under Artifacts here or run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is still under process but I will collect some potential issues to users or developers when we move this direction.
Idea: we usually only need to clone the matrix to generate new preconditioner or solver, but we do not need that for solver or preconditioner. It will remove the clone/copy_from out of LinOp.
We plan to have several prs to reach that, but need to have this to check whether we will have trouble having that.
Clonable: only Matrix now, but maybe also need stop criterion?
Note. Partition is also clonable.
I also include one test to show when user defines a custom class inherit from ginkgo class, which is already inherited from ClonableObject.
ExecutorHolder is unnecessary. will move back in the end.
clearis relying on theoperator=.I feel create_default and clear not need other than clone. we might be able to make LinOp without any mixin.
Issue:
.on(exec)strictly on user behalf. -> need to make it optional such that awareness of the cost and behavior.clone/copy_fromusage is a bit harder now because LinOp is not holdingclone/copy_from.gko::clone()takes care of that.as<LinOp>(as<ClonableObject>(linop)->clone()).copy_fromis worse because we might also need to useas<>in the input. Note. if they are concrete type, we can directly call the function.TODO: